package com.learning.platform.dto;

import com.learning.platform.entity.Certificate;
import com.learning.platform.enums.CertificateStatus;
import com.learning.platform.enums.CertificateTemplate;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class CertificateResponse {
    private Long id;
    private Long userId;
    private String userName; // 用户姓名
    private Long courseId;
    private String courseName; // 课程名称
    private String certificateNumber;
    private String certificateName;
    private LocalDate issueDate;
    private BigDecimal completionRate;
    private BigDecimal finalScore;
    private String verificationCode;
    private CertificateTemplate templateType;
    private CertificateStatus status;
    private String pdfUrl;
    private Long issuedBy;
    private String issuerName; // 颁发人姓名
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    // Constructors
    public CertificateResponse() {}
    
    public CertificateResponse(Certificate certificate) {
        this.id = certificate.getId();
        this.userId = certificate.getUserId();
        this.courseId = certificate.getCourseId();
        this.certificateNumber = certificate.getCertificateNumber();
        this.certificateName = certificate.getCertificateName();
        this.issueDate = certificate.getIssueDate();
        this.completionRate = certificate.getCompletionRate();
        this.finalScore = certificate.getFinalScore();
        this.verificationCode = certificate.getVerificationCode();
        this.templateType = certificate.getTemplateType();
        this.status = certificate.getStatus();
        this.pdfUrl = certificate.getPdfUrl();
        this.issuedBy = certificate.getIssuedBy();
        this.createdAt = certificate.getCreatedAt();
        this.updatedAt = certificate.getUpdatedAt();
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public String getUserName() {
        return userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }
    
    public Long getCourseId() {
        return courseId;
    }
    
    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }
    
    public String getCourseName() {
        return courseName;
    }
    
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    
    public String getCertificateNumber() {
        return certificateNumber;
    }
    
    public void setCertificateNumber(String certificateNumber) {
        this.certificateNumber = certificateNumber;
    }
    
    public String getCertificateName() {
        return certificateName;
    }
    
    public void setCertificateName(String certificateName) {
        this.certificateName = certificateName;
    }
    
    public LocalDate getIssueDate() {
        return issueDate;
    }
    
    public void setIssueDate(LocalDate issueDate) {
        this.issueDate = issueDate;
    }
    
    public BigDecimal getCompletionRate() {
        return completionRate;
    }
    
    public void setCompletionRate(BigDecimal completionRate) {
        this.completionRate = completionRate;
    }
    
    public BigDecimal getFinalScore() {
        return finalScore;
    }
    
    public void setFinalScore(BigDecimal finalScore) {
        this.finalScore = finalScore;
    }
    
    public String getVerificationCode() {
        return verificationCode;
    }
    
    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }
    
    public CertificateTemplate getTemplateType() {
        return templateType;
    }
    
    public void setTemplateType(CertificateTemplate templateType) {
        this.templateType = templateType;
    }
    
    public CertificateStatus getStatus() {
        return status;
    }
    
    public void setStatus(CertificateStatus status) {
        this.status = status;
    }
    
    public String getPdfUrl() {
        return pdfUrl;
    }
    
    public void setPdfUrl(String pdfUrl) {
        this.pdfUrl = pdfUrl;
    }
    
    public Long getIssuedBy() {
        return issuedBy;
    }
    
    public void setIssuedBy(Long issuedBy) {
        this.issuedBy = issuedBy;
    }
    
    public String getIssuerName() {
        return issuerName;
    }
    
    public void setIssuerName(String issuerName) {
        this.issuerName = issuerName;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}